package apiday02;

public class AddDemo {
    public static void main(String[] args) {
        /**
         * current:当前的
         * TimeMillis：时间毫秒
         * 1970年元旦开始到现在的毫秒数
         */
     String str = "";
     long t1 = System.currentTimeMillis();
     for (int i =0;i<50000;i++){
         str+="a";
     }
     long t2 = System.currentTimeMillis();
     System.out.println(t2-t1);

        /* String str = "";
      long t1 = System.currentTimeMillis();
      for (int i =0;i<50000;i++){
          str +="A";
      }
      long t2 = System.currentTimeMillis();
      System.out.println(t2-t1);

      */


       /* String str = "";
        long t1 = System.currentTimeMillis();
        for (int i = 0; i < 50000; i++) {
            str += "A";
        }
        long t2 = System.currentTimeMillis();

        System.out.println(t2 - t1);

        */
    }
}
